<?php
class Arm_Form_Element_Email extends Zend_Form_Element
{
  public function init(){
    parent::init();

    $this ->addValidator(new Zend_Validate_Regex('/^([0-9a-zA-Z]+([_.-]?[0-9a-zA-Z]+)*@[0-9a-zA-Z]+[0-9,a-z,A-Z,.,-]*(.){1}[a-zA-Z]{2,4})+$/'));
    $this ->setOptions(array(
      'onblur'      => 'validateEmail(this.id)',
    ));

    $this->addErrorMessage('e-mail inválido');
    $this ->addFilter('StripTags');
    $this ->addFilter('StringTrim');
  }
}
